package com.rongshu.view.userInfo.presenter;

import android.content.Context;

import com.rongshu.api.RetorfitService;
import com.rongshu.view.base.mvp.BasePresenter;
import com.rongshu.view.base.mvp.INetBean;
import com.rongshu.view.userInfo.iview.IdentityAuthenticationView;

import rx.Subscriber;

public class IdentityAuthenticationPresenter extends BasePresenter<IdentityAuthenticationView> {

    public IdentityAuthenticationPresenter(Context context) {
        super(context);
    }

    /**
     * 查询实名认证信息
     */
    public void getSelectRealNameAuthentication(int user_id, String sign) {
        RetorfitService.getSelectRealNameAuthentication(user_id, sign)
                .subscribe(new Subscriber<INetBean>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(INetBean bean) {
                        if (getView() != null) {
                            getView().onRealNameAuthentication(bean);
                        }
                    }
                });
    }
}
